package ${package_fallback};

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import ${package_pojo}.${Table};
import ${package_feign};
import entity.Result;
import org.springframework.stereotype.Component;
import io.swagger.v3.oas.annotations.parameters.RequestBody;

import java.util.List;

@Component
public class ${Table}Fallback implements ${Table}Feign {
    /***
     * 分页条件搜索实现${Table}
     * @param ${table}
     * @param page
     * @param size
     * @return
     */
    public Result<Page> findPage(@RequestBody(required = false) ${Table} ${table}, @PathVariable  int page, @PathVariable  int size){
        System.out.println("${Table}Fallback的findPage方法错误，错误日志已保存数据库了哦");
        System.out.println("数据:"+ ${table}+"和"+page+"和"+size);
        return null;
    };

    /***
     * 分页搜索实现${Table}
     * @param page:当前页
     * @param size:每页显示多少条
     * @return
     */
    public Result<Page> findPage(@PathVariable  int page, @PathVariable  int size){
        System.out.println("${Table}Fallback的findPage方法错误，错误日志已保存数据库了哦");
        System.out.println("数据:"+page+"和"+size);
        return null;
    }

    /***
     * 多条件搜索${Table}数据
     * @param ${table}
     * @return
     */
    public Result<List<${Table}>> findList(@RequestBody(required = false) ${Table} ${table}){
        System.out.println("${Table}Fallback的findList方法错误，错误日志已保存数据库了哦");
        System.out.println("数据:"+${table});
        return null;
    }

    /***
     * 根据Id删除${table}数据
     * @param id
     * @return
     */
    public Result delete(@PathVariable ${keyType} id){
        System.out.println("${Table}Fallback的delete方法错误，错误日志已保存数据库了哦");
        System.out.println("数据:"+id);
        return null;
    }

    /***
     * 根据ID修改${Table}数据
     * @param ${table}
     * @return
     */
    public Result updateById(@RequestBody ${Table} ${table}){
        System.out.println("${Table}Fallback的updateById方法错误，错误日志已保存数据库了哦");
        System.out.println("数据:"+${table});
        return null;
    }

    /***
     * 新增${Table}数据
     * @param ${table}
     * @return
     */
    public Result add(@RequestBody ${Table} ${table}){
        System.out.println("${Table}Fallback的add方法错误，错误日志已保存数据库了哦");
        System.out.println("数据:"+${table});
        return null;
    }

    /***
     * 根据ID查询${Table}数据
     * @param id
     * @return
     */
    public Result<${Table}> findById(@PathVariable ${keyType} id){
        System.out.println("${Table}Fallback的findById方法错误，错误日志已保存数据库了哦");
        System.out.println("数据:"+id);
        return null;
    }

    /***
     * 查询${Table}全部数据
     * @return
     */
    public Result<List<${Table}>> findAll(){
        System.out.println("${Table}Fallback的findAll方法错误，错误日志已保存数据库了哦");
        return null;
    }
}
